import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    resolve: {
        // 配置别名
        alias: {
            '@': resolve(__dirname, 'src'),
            '~': resolve(__dirname, 'src/components'),
            '#': resolve(__dirname, 'src/view'),
            '*': resolve(__dirname, 'src/assets'),
            '^': resolve(__dirname, 'src/pages'),
            '$': resolve(__dirname, 'src/services')
        }
    },
    server: {
        port: 8888,
        // 配置代理
        proxy: {
            '/api': 'http://localhost:3000'
        }
    }
})
